let socketUrl = "ws://127.0.0.1:8300/ws"
let apiUrl = "http://127.0.0.1:8100"

function getLocal(name) {
    let value = localStorage.getItem(name)
    if (value == null) {
        return ""
    } 
    return value
}

function setLocal(name,value){
    localStorage.setItem(name, value)
}

var UserInfo;
const RawHeaderLen = 10;
const VersionOffset = 2;
const LengthOffset  = 4;
const OptionOffset  = 6;
const SeqOffset     = 8;
const DataOffset    = 10;

const OpSingleSend    = 1;
const OpSingleSendAck = 2;
const OpGroupSend     = 3;
const OpGroupSendAck  = 4;
const OpBuildConn     = 5;
const OpOnlineUser    = 6;
const OpOnlineUserAck = 7;
const OpKickUserOnline = 8;
const OpKickUserOffline = 9;
const OpPing = 10;
const OpPong = 11;